﻿<Window x:Class="Moop.UI.Views.MainView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:r="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
        xmlns:ctls="clr-namespace:Moop.UI.Views"
        xmlns:converters="clr-namespace:Moop.UI.Converters"
        Icon="/Icons/DataSource.ico"
        Title="Moop - OLAP Client"
        Height="500"
        Width="400">

    <Window.Resources>
        <converters:BoolConverter x:Key="BoolConverter" />
    </Window.Resources>

    <Grid x:Name="LayoutRoot">

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <r:Ribbon x:Name="MainViewRibbon" Grid.Row="0">

            <r:Ribbon.ApplicationMenu>
                <r:RibbonApplicationMenu Visibility="Collapsed">
                </r:RibbonApplicationMenu>
            </r:Ribbon.ApplicationMenu>

            <r:RibbonTab x:Name="HomeTab" Header="Home">

                <r:RibbonGroup x:Name="MainGroup">

                    <r:RibbonButton x:Name="MainViewSetServerBtn"
                                    LargeImageSource="/Moop.UI.Assets;component/Images/64/start-here-64.png"
                                    ToolTip="Initialise Cube"
                                    ToolTipDescription="Initialise Cube - Get metadata from OLAP Service."
                                    Width="64"
                                    Height="64"                                    
                                    IsEnabled="{Binding IsBusy, Converter={StaticResource BoolConverter}}"
                                    Command="{Binding ServerViewModel.SetServerCommand}" />

                </r:RibbonGroup>

            </r:RibbonTab>

        </r:Ribbon>

        <Grid x:Name="InnerLayoutGrid"
              Grid.Row="1">

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <ctls:ServerView x:Name="AddServerView"
                             HorizontalAlignment="Stretch"
                             Grid.Column="0"
                             IsEnabled="{Binding IsBusy, Converter={StaticResource BoolConverter}}"
                             DataContext="{Binding ServerViewModel}"
                             Width="Auto" />

            <GridSplitter x:Name="MainGridSplitter"
                          Grid.Column="1"
                          HorizontalAlignment="Stretch"
                          VerticalAlignment="Stretch"
                          ResizeBehavior="PreviousAndNext"
                          ToolTip="Click to Minimize..."
                          MaxWidth="220"
                          IsTabStop="False"
                          Width="5"
                          Background="#FFBCBCBC" />

            <StackPanel Grid.Column="2">

            </StackPanel>


        </Grid>

    </Grid>

</Window>
